﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp1
{
    class Program
    {

        public static  void Main(string [] args)
        {
            // JiSuanQi();
            MianJi();
        }


        public static void JiSuanQi() 
        {
            Console.WriteLine("请输入第一个整数");
            int protected1 = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入第二个整数");
            int protected2 = int.Parse(Console.ReadLine());

            Console.WriteLine("请输入 1、加；2、减；3、乘；4、除");
            int key = int.Parse(Console.ReadLine());
            switch (key)
            {
                case 1:
                    Jia jia = new Jia();
                    jia.protected1 = protected1;
                    jia.protected2 = protected2;
                    jia.DisplayResult();
                    break;
                case 2:
                    Jian jian = new Jian();
                    jian.protected1 = protected1;
                    jian.protected2 = protected2;
                    jian.DisplayResult();
                    break;
                case 3:
                    Chen chen = new Chen();
                    chen.protected1 = protected1;
                    chen.protected2 = protected2;
                    chen.DisplayResult();
                    break;
                case 4:
                    Chu chu = new Chu();
                    chu.protected1 = protected1;
                    chu.protected2 = protected2;
                    chu.DisplayResult();
                    break;
                default:
                    break;
            }
        }//计算器
        public static void MianJi() {
            Console.WriteLine("请选择 1、圆形；2、长方形");
            int key = int.Parse(Console.ReadLine());
            switch (key)
            {
                case 1:
                    Console.WriteLine("请输入圆的半径：");
                    double Rradius = double.Parse(Console.ReadLine());
                    Circle c = new Circle();
                    c.radius = Rradius;
                    c.GetArea();
                    break;
                case 2:
                    Console.WriteLine("请输入正方形的边长：");
                    double sideLen = double.Parse(Console.ReadLine());
                    Square s = new Square();
                    s.sideLen = sideLen;
                    s.GetArea();
                    break;
                default:
                    break;
            }



        }
    }
}
